<?php 
## include required files
/*******************************/
require_once '../../includefiles.php';
require_once '../../model/users.php';
require_once '../../model/reviews.php';
require_once '../../redirect.php';
## creating objects of required models
$userObj 		= new Model_Users();
$reviewObj = new Model_Reviews();

checkUserLogin();

if($_SESSION['user_type'] == '3')
{
	@header("location:".SITE_URL."/");
	exit;
}


$userId =$_SESSION['getbids_id'];


if($_GET['id1'] !='')
{
		$reviewId = base64_decode($_GET['id1']);
		$review_details = $reviewObj->getReviewById($reviewId);
		//echo "<pre>";print_r($review_details );exit;	 
		$total_rating = $review_details['rating'];
		$smarty->assign('total_rating', $total_rating);
		if($total_rating < 5){
			$remaining_rating = 5 - $total_rating;
			$smarty->assign('remaining_rating', $remaining_rating);
		} 
		$smarty->assign('review_details', $review_details);
}


if($_SESSION['msg']){
		$smarty->assign("msg", $_SESSION['msg']);
		unset($_SESSION['msg']);
}

$active ="myaccount";
$smarty->assign('active',$active);
$subactive ="rating";
$smarty->assign('subactive',$subactive);
$smarty->assign('mainmenu',"6");

$smarty->display(TEMPLATEDIR.'/modules/rating/ratingdetail.tpl');
unset($smarty);
?>
